package mysql

import "e_mall_server/models"

/**
 * @Author: zhaobin
 * @Description TODO
 * @Date: 2022-05-12 9:56
 */

// UpdateSetting 修改商城设置信息
func UpdateSetting(setting *models.Setting) int64 {
	// 进行数据库修改操作
	return db.Debug().Model(&setting).Updates(&setting).RowsAffected
}

// GetSettingDetailById 通过商城设置id获取商城设置详细信息
func GetSettingDetailById(id int64) (setting models.Setting, err error) {
	setting.Id = id
	err = db.Where("id = ?", id).Find(&setting).Error
	return
}
